package fr.charlesen.projets.utt.lo09.entites;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Charles EDOU NZE
 */
@Entity
@Table(name = "RESPSTAGES", catalog = "", schema = "CHARLES")
@NamedQueries({
    @NamedQuery(name = "Respstages.findAll", query = "SELECT r FROM Respstages r"),
    @NamedQuery(name = "Respstages.findById", query = "SELECT r FROM Respstages r WHERE r.id = :id"),
    @NamedQuery(name = "Respstages.findByNom", query = "SELECT r FROM Respstages r WHERE r.nom = :nom"),
    @NamedQuery(name = "Respstages.findByPrenom", query = "SELECT r FROM Respstages r WHERE r.prenom = :prenom"),
    @NamedQuery(name = "Respstages.findByBureau", query = "SELECT r FROM Respstages r WHERE r.bureau = :bureau"),
    @NamedQuery(name = "Respstages.findByEmail", query = "SELECT r FROM Respstages r WHERE r.email = :email"),
    @NamedQuery(name = "Respstages.findByLogin", query = "SELECT r FROM Respstages r WHERE r.login = :login"),
    @NamedQuery(name = "Respstages.findByMdp", query = "SELECT r FROM Respstages r WHERE r.mdp = :mdp")})
public class Respstages implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "NOM", nullable = false, length = 45)
    private String nom;
    @Basic(optional = false)
    @Column(name = "PRENOM", nullable = false, length = 45)
    private String prenom;
    @Basic(optional = false)
    @Column(name = "BUREAU", nullable = false, length = 45)
    private String bureau;
    @Basic(optional = false)
    @Column(name = "EMAIL", nullable = false, length = 45)
    private String email;
    @Basic(optional = false)
    @Column(name = "LOGIN", nullable = false, length = 45)
    private String login;
    @Basic(optional = false)
    @Column(name = "MDP", nullable = false, length = 45)
    private String mdp;
    @OneToOne(mappedBy = "idRespstages")
    private Collection<Programmes> programmesCollection;

    public Respstages() {
    }

    public Respstages(Integer id) {
        this.id = id;
    }

    public Respstages(Integer id, String nom, String prenom, String bureau, String email, String login, String mdp) {
        this.id = id;
        this.nom = nom;
        this.prenom = prenom;
        this.bureau = bureau;
        this.email = email;
        this.login = login;
        this.mdp = mdp;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getBureau() {
        return bureau;
    }

    public void setBureau(String bureau) {
        this.bureau = bureau;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getMdp() {
        return mdp;
    }

    public void setMdp(String mdp) {
        this.mdp = mdp;
    }

    public Collection<Programmes> getProgrammesCollection() {
        return programmesCollection;
    }

    public void setProgrammesCollection(Collection<Programmes> programmesCollection) {
        this.programmesCollection = programmesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Respstages)) {
            return false;
        }
        Respstages other = (Respstages) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.charlesen.projets.utt.lo09.enites.Respstages[id=" + id + "]";
    }

}
